using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MyHunter.New
{
    public partial class NewCollection : Form
    {
        #region MEMBERS
        public string CollectionPath
        {
            get { return this.labelCollPath.Text + "\\"; }
        }


        public string CsvFolder
        {
            get { return labelCsv.Text + "\\"; }
        }

        public string CollectionName
        {
            get { return this.textBoxName.Text; }
        }

        public string Description
        {
            get { return this.textBoxDescription.Text; }
        }

        public string SiteName
        {
            get { return this.comboBoxSite.Text; }
        }
        #endregion

        #region CTOR
        public NewCollection()
        {
            InitializeComponent();

            this.comboBoxSite.DataSource = DataSchema.Settings.SettingsMgr.Settings.Sites;
            this.comboBoxSite.DisplayMember = "Name";
            this.comboBoxSite.ValueMember = "Name";
        }
        #endregion

        #region EVENTS
        private void btnCSVFoleder_Click(object sender, EventArgs e)
        {
            folderBrowserDialog.SelectedPath = DataSchema.Settings.SettingsMgr.DefaultCSVPath;
            if (this.folderBrowserDialog.ShowDialog() == DialogResult.OK)
            {
                labelCsv.Text = folderBrowserDialog.SelectedPath;
            }
        }

        private void buttonCollPath_Click(object sender, EventArgs e)
        {
            folderBrowserDialog.SelectedPath = DataSchema.Settings.SettingsMgr.DefaultCollectionsPath;
            if (this.folderBrowserDialog.ShowDialog() == DialogResult.OK)
            {
                this.labelCollPath.Text = folderBrowserDialog.SelectedPath;
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if(this.textBoxName.Text != "" &&
                this.labelCollPath.Text != "" &&
                this.labelCsv.Text != "")
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
                HunterForm.ShowMsg("Fill required information first!", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        private void NewCollection_Load(object sender, EventArgs e)
        {

        }
        #endregion
    }
}